/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package ace.system;

import java.util.Random;

/**
 *
 * @author Hallucinogen
 */
public class GameRandom extends Random {
	private GameRandom(long seed) {
		super(seed);
	}

	private static GameRandom instance() {
		if (sGenerator == null)  {
			sGenerator = new GameRandom(System.currentTimeMillis());
		}
		return sGenerator;
	}

	public static float floatRandom() {
		return instance().nextFloat() * 2.0f - 1.0f;
	}

	public static int intRandom(int variance) {
		return (int)(floatRandom() * variance);
	}

	private static GameRandom sGenerator ;
}
